﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDD;

namespace DevApp {
    public class BounceBall : Component {

        public float Velocity {
            get;
            set;
        }

        public BounceBall () {
            Velocity = 0;
        }


        public override void OnUpdate (int time) {
            
            Node.Translate (0, Velocity, 0);
            Velocity = (Node.Translation.Y > 0) ? Velocity - 0.015f : -Velocity;
        }

    }
}
